package com.dyh.quickdemo.demos.resTemplateInsp;

import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;

import java.io.IOException;

/*
@Author=Joey Wheeler
@Date=2020/10/19 16:58
*/
public class MyInterceptor  implements ClientHttpRequestInterceptor {
    @Override
    public ClientHttpResponse intercept(HttpRequest httpRequest, byte[] bytes, ClientHttpRequestExecution clientHttpRequestExecution) throws IOException {

        /*这里是原封不动返回  ribbon直接替换掉了*/
        return clientHttpRequestExecution.execute(httpRequest, bytes);
    }
}

/*

*/
